package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.User;
import com.ruoyi.system.mapper.UserMapper;
import com.ruoyi.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    
    @Autowired
    private UserMapper userDao;

    @Override
    public List<User> listUser() {
        return userDao.listUser();
    }

    @Override
    public User getUserByName(String loginName) {
        return userDao.getUserByName(loginName);
    }

    @Override
    public int saveUser(User user) {
        return userDao.saveUser(user);
    }

    @Override
    public int updateUser(User user) {
        user.setUpdateTime(new Date());
        return userDao.updateUser(user);
    }

    @Override
    public void deleteUser(Long userid) {
        userDao.deleteUser(userid);
    }
}
